#ifndef _TNET_UTILS_WINPRT_H_
#define _TNET_UTILS_WINPRT_H_

#include "tnet_types.h"
#include "tnet_socket.h"

#ifdef __cplusplus
extern "C" {
#endif
	
#if TNET_UNDER_WINDOWS_PHONE && !defined(USE_WINRT_NETWORKING)

#define tnet_get_sockaddr_size(psockaddr)	((psockaddr)->sa_family == AF_INET6 ? sizeof(struct sockaddr_in6): ((psockaddr)->sa_family == AF_INET ? sizeof(struct sockaddr_in) : sizeof(*(psockaddr))))
TINYNET_API int tnet_geterrno();
TINYNET_API int tnet_sockfd_waitUntil(tnet_fd_t fd, long timeout, tsk_bool_t writable);
#define tnet_sockfd_waitUntilWritable(fd, timeout) tnet_sockfd_waitUntil(fd, timeout, tsk_true)

#endif

#ifdef __cplusplus
}
#endif

#endif